SET mapreduce.map.memory.mb = 8096;
SET mapreduce.map.cpu.vcores = 4;
SET hive.tez.container.size = 8096;
SET hive.tez.cpu.vcores = 4;
set hive.mapred.mode=undefined;
INSERT OVERWRITE TABLE jms_dm.dm_cn_address_warehouse_day_rule_dt PARTITION (dt = '{{ execution_date | cst_ds }}')
SELECT g.province_id,
       g.province_name,
       g.city_id,
       g.city_name,
       g.area_id,
       g.area_name,
       g.township,
       g.street,
       g.detailed_address,
       g.send_counts,
       g.receive_counts,
       g.update_timestamp,
       g.md5_id,
       g.network_id,
       g.network_code,
       g.network_name,
       g.first_code_id,
       g.second_code_id,
       g.third_code_id,
       g.first_code,
       g.second_code,
       g.third_code,
       g.lng,
       g.lat,
       g.lon_lat_from,
       g.address_type,
       g.errcodeenum,
       g.full_address,
       g.waybill_no
  FROM (SELECT province_id,
               province_name,
               city_id,
               city_name,
               area_id,
               area_name,
               CASE WHEN (township IS NULL) THEN ""
                                            ELSE township
                   END                                                       AS township,
               CASE WHEN (street IS NULL) THEN ""
                                          ELSE street
                   END                                                       AS street,
               detailed_address,
               send_counts,
               receive_counts,
               update_timestamp,
               md5_id,
               network_id,
               network_code,
               network_name,
               first_code_id,
               second_code_id,
               third_code_id,
               first_code,
               second_code,
               third_code,
               lng,
               lat,
               lon_lat_from,
               address_type,
               CASE WHEN (errcodeenum IS NULL) THEN ""
                                               ELSE errcodeenum
                   END                                                       AS errcodeenum,
               concat(province_name, city_name, area_name, detailed_address) AS full_address,
               waybill_no
          FROM jms_dwd.dwd_cn_address_warehouse_day_dt
         WHERE dt = '{{ execution_date | cst_ds_nodash }}') g
  LEFT JOIN
  jms_dwd.dwd_cn_address_warehouse_es_dt  h
  ON g.md5_id = h.md5_id
 WHERE h.md5_id IS NULL;